import { BasicFetchResult } from '../model/baseModel';
import { defHttp } from '@/utils/http/axios';
const api = '/sysTreeDict';
/**
 * 查询系统树形字典不分页
 * @author frank
 * @date 2023-08-25 09:13:00
 */
export const list = (params?: any) =>
  defHttp.get<BasicFetchResult<any>>({ url: api + '/list', params });
/**
 * 添加系统树形字典
 * @author frank
 * @date 2023-08-25 09:13:00
 */
export const add = (params?: any) =>
  defHttp.post({ url: api + '/add', params });
/**
 * 修改系统树形字典
 * @author frank
 * @date 2023-08-25 09:13:00
 */
export const edit = (params?: any) =>
  defHttp.post({ url: api + '/edit', params });

/**
 * 删除系统树形字典
 * @author frank
 * @date 2023-08-25 09:13:00
 */
export const del = (ids: string[]) =>
  defHttp.post({ url: api + '/delete', params: ids });
export const getByPid = (pid: string) =>
  defHttp.get({ url: api + '/pidList', params: { pid } });
export const getByPidAll = (hasRoot = false) =>
  defHttp.get({ url: api + '/pidAllList', params: { hasRoot } });
